﻿<Activity mc:Ignorable="sap sap2010 sads" x:Class="WFExtended.Samples.Activities.TwitterDirectMessageSample"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mca="clr-namespace:Microsoft.CSharp.Activities;assembly=System.Activities"
 xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
 xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
 xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
 xmlns:wfs="clr-namespace:WFExtended.Framework.ServiceModel;assembly=WFExtended"
 xmlns:wt="clr-namespace:WFExtended.Twitter;assembly=WFExtended.Twitter"
 xmlns:wta="clr-namespace:WFExtended.Twitter.Activities;assembly=WFExtended.Twitter"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <x:Members>
    <x:Property Name="Tokens" Type="InArgument(wt:OAuthTokens)" />
    <x:Property Name="UserAccessTokenSecret" Type="InArgument(x:String)" />
    <x:Property Name="UserAccessToken" Type="InArgument(x:String)" />
  </x:Members>
  <sap2010:ExpressionActivityEditor.ExpressionActivityEditor>C#</sap2010:ExpressionActivityEditor.ExpressionActivityEditor>
  <sap2010:WorkflowViewState.IdRef>WFExtended.Samples.Activities.TwitterDirectMessageSample_1</sap2010:WorkflowViewState.IdRef>
  <TextExpression.NamespacesForImplementation>
    <sco:Collection x:TypeArguments="x:String">
      <x:String>System</x:String>
      <x:String>System.Collections.Generic</x:String>
      <x:String>System.Data</x:String>
      <x:String>System.Linq</x:String>
      <x:String>System.Text</x:String>
      <x:String>WFExtended.Twitter</x:String>
    </sco:Collection>
  </TextExpression.NamespacesForImplementation>
  <TextExpression.ReferencesForImplementation>
    <sco:Collection x:TypeArguments="AssemblyReference">
      <AssemblyReference>System</AssemblyReference>
      <AssemblyReference>System.Activities</AssemblyReference>
      <AssemblyReference>System.Core</AssemblyReference>
      <AssemblyReference>System.Drawing</AssemblyReference>
      <AssemblyReference>System.Runtime.DurableInstancing</AssemblyReference>
      <AssemblyReference>System.Runtime.Serialization</AssemblyReference>
      <AssemblyReference>System.ServiceModel</AssemblyReference>
      <AssemblyReference>System.ServiceModel.Activities</AssemblyReference>
      <AssemblyReference>System.ServiceModel.Discovery</AssemblyReference>
      <AssemblyReference>System.Xaml</AssemblyReference>
      <AssemblyReference>System.Xml.Linq</AssemblyReference>
      <AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
      <AssemblyReference>Microsoft.CSharp</AssemblyReference>
      <AssemblyReference>System.Data</AssemblyReference>
      <AssemblyReference>System.Xml</AssemblyReference>
      <AssemblyReference>WFExtended.Twitter</AssemblyReference>
      <AssemblyReference>WFExtended</AssemblyReference>
      <AssemblyReference>mscorlib</AssemblyReference>
      <AssemblyReference>WFExtended.Samples</AssemblyReference>
    </sco:Collection>
  </TextExpression.ReferencesForImplementation>
  <wta:TwitterProxy RetryCount="{x:Null}" RetryDelay="{x:Null}" EnablePersistence="True" sap2010:WorkflowViewState.IdRef="TwitterProxy_1" UseSsl="True">
    <wta:TwitterProxy.ApplicationAccessToken>
      <InArgument x:TypeArguments="x:String">
        <mca:CSharpValue x:TypeArguments="x:String">Tokens.ApplicationAccessToken</mca:CSharpValue>
      </InArgument>
    </wta:TwitterProxy.ApplicationAccessToken>
    <wta:TwitterProxy.ApplicationAccessTokenSecret>
      <InArgument x:TypeArguments="x:String">
        <mca:CSharpValue x:TypeArguments="x:String">Tokens.ApplicationAccessTokenSecret</mca:CSharpValue>
      </InArgument>
    </wta:TwitterProxy.ApplicationAccessTokenSecret>
    <wta:TwitterProxy.ConsumerKey>
      <InArgument x:TypeArguments="x:String">
        <mca:CSharpValue x:TypeArguments="x:String">Tokens.ConsumerKey</mca:CSharpValue>
      </InArgument>
    </wta:TwitterProxy.ConsumerKey>
    <wta:TwitterProxy.ConsumerSecret>
      <InArgument x:TypeArguments="x:String">
        <mca:CSharpValue x:TypeArguments="x:String">Tokens.ConsumerSecret</mca:CSharpValue>
      </InArgument>
    </wta:TwitterProxy.ConsumerSecret>
    <wta:TwitterProxy.EndPointBehaviors>
      <InArgument x:TypeArguments="scg:List(p:IEndpointBehavior)" />
    </wta:TwitterProxy.EndPointBehaviors>
    <wta:TwitterProxy.Headers>
      <InArgument x:TypeArguments="scg:List(p:AddressHeader)" />
    </wta:TwitterProxy.Headers>
    <wta:TwitterProxy.Proxy>
      <InArgument x:TypeArguments="wfs:WcfProxy(wt:ITwitterApi)" />
    </wta:TwitterProxy.Proxy>
    <ActivityAction x:TypeArguments="wfs:WcfProxy(wt:ITwitterApi)">
      <ActivityAction.Argument>
        <DelegateInArgument x:TypeArguments="wfs:WcfProxy(wt:ITwitterApi)" Name="twitterProxy" />
      </ActivityAction.Argument>
      <Sequence sap2010:WorkflowViewState.IdRef="Sequence_1">
        <Sequence.Variables>
          <Variable x:TypeArguments="scg:List(wt:DirectMessage)" Name="messages" />
          <Variable x:TypeArguments="scg:List(wt:DirectMessage)" Name="messagesSent" />
        </Sequence.Variables>
        <wta:TwitterUserContext sap2010:WorkflowViewState.IdRef="TwitterUserContext_1">
          <wta:TwitterUserContext.UserAccessToken>
            <InArgument x:TypeArguments="x:String">
              <mca:CSharpValue x:TypeArguments="x:String">UserAccessToken</mca:CSharpValue>
            </InArgument>
          </wta:TwitterUserContext.UserAccessToken>
          <wta:TwitterUserContext.UserAccessTokenSecret>
            <InArgument x:TypeArguments="x:String">
              <mca:CSharpValue x:TypeArguments="x:String">UserAccessTokenSecret</mca:CSharpValue>
            </InArgument>
          </wta:TwitterUserContext.UserAccessTokenSecret>
          <ActivityAction>
            <Sequence sap2010:WorkflowViewState.IdRef="Sequence_2">
              <Sequence.Variables>
                <Variable x:TypeArguments="wt:DirectMessage" Name="message" />
              </Sequence.Variables>
              <wta:GetDirectMessages sap2010:WorkflowViewState.IdRef="GetDirectMessages_2" OperationName="GetDirectMessagesWithOptions">
                <wta:GetDirectMessages.Count>
                  <InArgument x:TypeArguments="x:Int32">
                    <mca:CSharpValue x:TypeArguments="x:Int32">20</mca:CSharpValue>
                  </InArgument>
                </wta:GetDirectMessages.Count>
                <wta:GetDirectMessages.IncludeEntities>
                  <InArgument x:TypeArguments="x:Boolean">
                    <mca:CSharpValue x:TypeArguments="x:Boolean">true</mca:CSharpValue>
                  </InArgument>
                </wta:GetDirectMessages.IncludeEntities>
                <wta:GetDirectMessages.MaxID>
                  <InArgument x:TypeArguments="x:String" />
                </wta:GetDirectMessages.MaxID>
                <wta:GetDirectMessages.Parameters>
                  <scg:Dictionary x:TypeArguments="x:String, InArgument" />
                </wta:GetDirectMessages.Parameters>
                <wta:GetDirectMessages.Proxy>
                  <InArgument x:TypeArguments="wfs:AWcfProxy">
                    <mca:CSharpValue x:TypeArguments="wfs:AWcfProxy">twitterProxy</mca:CSharpValue>
                  </InArgument>
                </wta:GetDirectMessages.Proxy>
                <wta:GetDirectMessages.Result>
                  <OutArgument x:TypeArguments="scg:List(wt:DirectMessage)">
                    <mca:CSharpReference x:TypeArguments="scg:List(wt:DirectMessage)">messages</mca:CSharpReference>
                  </OutArgument>
                </wta:GetDirectMessages.Result>
                <wta:GetDirectMessages.SinceID>
                  <InArgument x:TypeArguments="x:String" />
                </wta:GetDirectMessages.SinceID>
                <wta:GetDirectMessages.SkipStatus>
                  <InArgument x:TypeArguments="x:Boolean">
                    <mca:CSharpValue x:TypeArguments="x:Boolean">false</mca:CSharpValue>
                  </InArgument>
                </wta:GetDirectMessages.SkipStatus>
              </wta:GetDirectMessages>
              <wta:GetDirectMessagesSent sap2010:WorkflowViewState.IdRef="GetDirectMessagesSent_1" OperationName="GetDirectMessagesSentWithOptions">
                <wta:GetDirectMessagesSent.Count>
                  <InArgument x:TypeArguments="x:Int32">
                    <mca:CSharpValue x:TypeArguments="x:Int32">20</mca:CSharpValue>
                  </InArgument>
                </wta:GetDirectMessagesSent.Count>
                <wta:GetDirectMessagesSent.IncludeEntities>
                  <InArgument x:TypeArguments="x:Boolean">
                    <mca:CSharpValue x:TypeArguments="x:Boolean">true</mca:CSharpValue>
                  </InArgument>
                </wta:GetDirectMessagesSent.IncludeEntities>
                <wta:GetDirectMessagesSent.MaxID>
                  <InArgument x:TypeArguments="x:String" />
                </wta:GetDirectMessagesSent.MaxID>
                <wta:GetDirectMessagesSent.Parameters>
                  <scg:Dictionary x:TypeArguments="x:String, InArgument" />
                </wta:GetDirectMessagesSent.Parameters>
                <wta:GetDirectMessagesSent.Proxy>
                  <InArgument x:TypeArguments="wfs:AWcfProxy">
                    <mca:CSharpValue x:TypeArguments="wfs:AWcfProxy">twitterProxy</mca:CSharpValue>
                  </InArgument>
                </wta:GetDirectMessagesSent.Proxy>
                <wta:GetDirectMessagesSent.Result>
                  <OutArgument x:TypeArguments="scg:List(wt:DirectMessage)">
                    <mca:CSharpReference x:TypeArguments="scg:List(wt:DirectMessage)">messagesSent</mca:CSharpReference>
                  </OutArgument>
                </wta:GetDirectMessagesSent.Result>
                <wta:GetDirectMessagesSent.SinceID>
                  <InArgument x:TypeArguments="x:String" />
                </wta:GetDirectMessagesSent.SinceID>
              </wta:GetDirectMessagesSent>
              <If sap2010:WorkflowViewState.IdRef="If_1">
                <If.Condition>
                  <InArgument x:TypeArguments="x:Boolean">
                    <mca:CSharpValue x:TypeArguments="x:Boolean">messagesSent.Count &gt; 0</mca:CSharpValue>
                  </InArgument>
                </If.Condition>
                <If.Then>
                  <Sequence sap2010:WorkflowViewState.IdRef="Sequence_3">
                    <wta:ShowDirectMessage sap2010:WorkflowViewState.IdRef="ShowDirectMessage_1" OperationName="ShowDirectMessage">
                      <wta:ShowDirectMessage.ID>
                        <InArgument x:TypeArguments="x:Int64">
                          <mca:CSharpValue x:TypeArguments="x:Int64">messagesSent[0].ID</mca:CSharpValue>
                        </InArgument>
                      </wta:ShowDirectMessage.ID>
                      <wta:ShowDirectMessage.Parameters>
                        <scg:Dictionary x:TypeArguments="x:String, InArgument" />
                      </wta:ShowDirectMessage.Parameters>
                      <wta:ShowDirectMessage.Proxy>
                        <InArgument x:TypeArguments="wfs:AWcfProxy">
                          <mca:CSharpValue x:TypeArguments="wfs:AWcfProxy">twitterProxy</mca:CSharpValue>
                        </InArgument>
                      </wta:ShowDirectMessage.Proxy>
                      <wta:ShowDirectMessage.Result>
                        <OutArgument x:TypeArguments="wt:DirectMessage">
                          <mca:CSharpReference x:TypeArguments="wt:DirectMessage">message</mca:CSharpReference>
                        </OutArgument>
                      </wta:ShowDirectMessage.Result>
                    </wta:ShowDirectMessage>
                    <WriteLine sap2010:WorkflowViewState.IdRef="WriteLine_2">
                      <InArgument x:TypeArguments="x:String">
                        <mca:CSharpValue x:TypeArguments="x:String">message.Text</mca:CSharpValue>
                      </InArgument>
                    </WriteLine>
                    <wta:DeleteDirectMessage MessageID="{x:Null}" Result="{x:Null}" sap2010:WorkflowViewState.IdRef="DeleteDirectMessage_1" OperationName="DeleteDirectMessage">
                      <wta:DeleteDirectMessage.Message>
                        <InArgument x:TypeArguments="wt:DirectMessage">
                          <mca:CSharpValue x:TypeArguments="wt:DirectMessage">message</mca:CSharpValue>
                        </InArgument>
                      </wta:DeleteDirectMessage.Message>
                      <wta:DeleteDirectMessage.Parameters>
                        <scg:Dictionary x:TypeArguments="x:String, InArgument" />
                      </wta:DeleteDirectMessage.Parameters>
                      <wta:DeleteDirectMessage.Proxy>
                        <InArgument x:TypeArguments="wfs:AWcfProxy">
                          <mca:CSharpValue x:TypeArguments="wfs:AWcfProxy">twitterProxy</mca:CSharpValue>
                        </InArgument>
                      </wta:DeleteDirectMessage.Proxy>
                    </wta:DeleteDirectMessage>
                  </Sequence>
                </If.Then>
              </If>
              <wta:SendDirectMessage Result="{x:Null}" sap2010:WorkflowViewState.IdRef="AddDirectMessage_1" OperationName="AddDirectMessageWithUsername" Username="CuteChristina22">
                <wta:SendDirectMessage.Parameters>
                  <scg:Dictionary x:TypeArguments="x:String, InArgument" />
                </wta:SendDirectMessage.Parameters>
                <wta:SendDirectMessage.Proxy>
                  <InArgument x:TypeArguments="wfs:AWcfProxy">
                    <mca:CSharpValue x:TypeArguments="wfs:AWcfProxy">twitterProxy</mca:CSharpValue>
                  </InArgument>
                </wta:SendDirectMessage.Proxy>
                <wta:SendDirectMessage.Text>
                  <InArgument x:TypeArguments="x:String">
                    <mca:CSharpValue x:TypeArguments="x:String">DateTime.Now.Second.ToString()</mca:CSharpValue>
                  </InArgument>
                </wta:SendDirectMessage.Text>
              </wta:SendDirectMessage>
            </Sequence>
          </ActivityAction>
        </wta:TwitterUserContext>
      </Sequence>
    </ActivityAction>
    <sads:DebugSymbol.Symbol>d1pFOlxQcm9qZWN0c1xXRkVcTWFpblxTb3VyY2VzXFdGRXh0ZW5kZWQuU2FtcGxlc1xBY3Rpdml0aWVzXFR3aXR0ZXJEaXJlY3RNZXNzYWdlU2FtcGxlLnhhbWwlNwP5ARYCAQE6CTpkAwG4AT8JP2oDAbQBRAlEWQMBsAFJCUlcAwGsAVkH9gESAgECXgn1ASICAQNhD2FcAwGlAWYPZmIDAZ4Bag3zARgCAQRuD5EBJwIBdZIBD7ABKwIBVLEBD+MBFAIBF+QBD/IBJwIBBY4BFY4BWQMBlgGBARWBAWQDAY4BcRVxVAMBhgF2FXZYAgF+hgEVhgF1AgF2pQEVpQFkAgFtlQEVlQFUAgFlmgEVmgFYAgFdqgEVqgF5AgFVtAEVtAFtAgEYuAET4QEeAgEg6gEV6gFkAgEP7wEV7wFxAgEH5AGjAeQBtAECAQa5ARXMAS0CATvNARXRASECATLSARXgAS8CASHEARvEAWoCAUy8ARu8AWoCAUTJARvJAXACATzPARnPAWMCATPVARvVAWgCASrdARvdAWoCASI=</sads:DebugSymbol.Symbol>
  </wta:TwitterProxy>
  <sap2010:WorkflowViewState.ViewStateManager>
    <sap2010:ViewStateManager>
      <sap2010:ViewStateData Id="GetDirectMessages_2" sap:VirtualizedContainerService.HintSize="464,72" />
      <sap2010:ViewStateData Id="GetDirectMessagesSent_1" sap:VirtualizedContainerService.HintSize="464,72" />
      <sap2010:ViewStateData Id="ShowDirectMessage_1" sap:VirtualizedContainerService.HintSize="211,108" />
      <sap2010:ViewStateData Id="WriteLine_2" sap:VirtualizedContainerService.HintSize="211,62" />
      <sap2010:ViewStateData Id="DeleteDirectMessage_1" sap:VirtualizedContainerService.HintSize="211,72" />
      <sap2010:ViewStateData Id="Sequence_3" sap:VirtualizedContainerService.HintSize="233,446">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="If_1" sap:VirtualizedContainerService.HintSize="464,596" />
      <sap2010:ViewStateData Id="AddDirectMessage_1" sap:VirtualizedContainerService.HintSize="464,108" />
      <sap2010:ViewStateData Id="Sequence_2" sap:VirtualizedContainerService.HintSize="486,1092">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="TwitterUserContext_1" sap:VirtualizedContainerService.HintSize="516,1216" />
      <sap2010:ViewStateData Id="Sequence_1" sap:VirtualizedContainerService.HintSize="538,1340">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="TwitterProxy_1" sap:VirtualizedContainerService.HintSize="568,1464" />
      <sap2010:ViewStateData Id="WFExtended.Samples.Activities.TwitterDirectMessageSample_1" sap:VirtualizedContainerService.HintSize="608,1544" />
    </sap2010:ViewStateManager>
  </sap2010:WorkflowViewState.ViewStateManager>
</Activity>